using System;
using System.Threading;
using System.Threading.Tasks;
using Quartz;

namespace Infrastructure.Quartz
{
    /// <summary>
    /// Quartz调度任务触发器监听器
    /// </summary>
    internal class GlobalTriggerListener : ITriggerListener
    {
        public string Name => "GlobalTriggerListener";

        public Task TriggerComplete(ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode, CancellationToken cancellationToken = default)
        {
            return Task.Run(() => { });
        }

        public Task TriggerFired(ITrigger trigger, IJobExecutionContext context, CancellationToken cancellationToken = default)
        {
            return Task.Run(() => { });
        }

        public Task TriggerMisfired(ITrigger trigger, CancellationToken cancellationToken = default)
        {
            return Task.Run(() => { });
        }

        public Task<bool> VetoJobExecution(ITrigger trigger, IJobExecutionContext context, CancellationToken cancellationToken = default)
        {
            return Task.Run(() => true);
        }
    }
}